import type { ContactService } from '@ipos_th/shared/src/services/contact.service'
import {
  Body,
  Controller,
  Delete,
  Get,
  Inject,
  Param,
  Patch,
  Post,
} from '@nestjs/common'
import type { CreateContactDto } from './dto/create-contact.dto'
import type { UpdateContactDto } from './dto/update-contact.dto'

@Controller('contact')
export class ContactController {
  constructor(
    @Inject('CONTACT_SERVICE')
    private readonly contactService: ContactService,
  ) {}
  @Post()
  create(@Body() createContactDto: CreateContactDto) {
    return this.contactService.create()
  }

  @Get()
  findAll() {
    return this.contactService.findAll()
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.contactService.findOne(+id)
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateContactDto: UpdateContactDto) {
    return this.contactService.update(+id, updateContactDto)
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.contactService.remove(+id)
  }
}
